﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Chat_Model
{
    /// <summary>
    /// 用户聊天记录表
    ///</summary>
    [SugarTable("lar_talk_records")]
    public class LarTalkRecords
    {
        /// <summary>
        /// 聊天记录ID 
        ///</summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        /// <summary>
        /// 对话类型[1:私信;2:群聊;] 
        /// 默认值: 1
        ///</summary>
        [SugarColumn(ColumnName = "talk_type")]
        public int TalkType { get; set; }
        /// <summary>
        /// 消息类型[1:文本消息;2:文件消息;3:会话消息;4:代码消息;5:投票消息;6:群公告;7:好友申请;8:登录通知;9:入群消息/退群消息;] 
        /// 默认值: 1
        ///</summary>
        [SugarColumn(ColumnName = "msg_type")]
        public int MsgType { get; set; }
        /// <summary>
        /// 发送者ID（0:代表系统消息 &gt;0: 用户ID） 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "user_id")]
        public int UserId { get; set; }
        /// <summary>
        /// 接收者ID（用户ID 或 群ID） 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "receiver_id")]
        public int ReceiverId { get; set; }
        /// <summary>
        /// 文本消息 {@nickname@} 
        ///</summary>
        [SugarColumn(ColumnName = "content")]
        public string Content { get; set; }
        /// <summary>
        /// 是否撤回消息[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_revoke")]
        public byte IsRevoke { get; set; } = 0;
        /// <summary>
        /// 创建时间 
        ///</summary>
        [SugarColumn(ColumnName = "created_at")]
        public DateTime CreatedAt { get; set; } = DateTime.Now;
        /// <summary>
        /// 是否重要消息[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_mark")]
        public byte IsMark { get; set; } = 0;
        /// <summary>
        /// 是否已读[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_read")]
        public byte? IsRead { get; set; } = 0;
        /// <summary>
        /// 引用消息ID 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "quote_id")]
        public int QuoteId { get; set; } = 0;
        /// <summary>
        /// @好友 、 多个用英文逗号 “,” 拼接 (0:代表所有人) 
        /// 默认值: 
        ///</summary>
        [SugarColumn(ColumnName = "warn_users")]
        public string WarnUsers { get; set; } = String.Empty;
        /// <summary>
        /// 更新时间 
        ///</summary>
        [SugarColumn(ColumnName = "updated_at")]
        public DateTime? UpdatedAt { get; set; } = DateTime.Now;
        /// <summary>
        /// 朋友关系的ID
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public LarUsersFriends LarUsersFriends { get; set; }
        /// <summary>
        /// 朋友的信息
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public LarUsers LarUsers { get; set; }
        /// <summary>
        /// 聊天列表
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public LarTalkList LarTalkList { get; set; }
    }
}
